Documentation for class polyline_object

Inherits from 	ornament 

Properties declared in polyline_object 
	linejoin 
	points 

Class Methods declared in polyline_object 
	new 

Methods declared in polyline_object 
	action 
		remove_first_point 
		remove_last_point 
	any 
		add_first(x, y) 
		add_last(x, y) 
		add_point_first(new_point) 
		add_point_last(new_point) 
		at(index) 
		change_at(index, x, y) 
		insert_at(index, x, y) 
		insert_point_at(index , new_point) 
		linejoin 
		points 
		remove_first_point 
		remove_last_point 
		remove_point_at(index) 
		replace_point_at(index , new_point) 
		set_linejoin(mode) 
		size 
	get 
		linejoin 
		points 
	set 
		set_linejoin(mode) 

Class 
#begin_class
polyline_object 
The class polyline_object is a subclass of the class ornament. 
The class polyline_object is a so-called abstract class. It implements the methods that is shared by both polyline and polygon. 
Note: You cannot create instances of an abstract class.
A polyline_object is defined by a collection of points that specifies its outline.
#end_class

Properties 

#begin_property
linejoin 
Stores the way lines are connected. The different types of linejoin are:
#sharp
#round
#chopped
Default is #sharp.
#end_property

#begin_property
points 
Stores the collection of points that specifies the outline of the polyline object.
#end_property

Methods 

#begin_method
add_first(x, y) 
Adds the point {x y} first in the collection points.
Returns self.
#end_method

#begin_method
add_last(x, y) 
Adds the point {x y} last in the collection points.
Returns self.
#end_method

#begin_method
add_point_first(new_point) 
Adds the point new_point first in the collection points.
Returns self.
Ex:
{polygon p}:add_point_first({20 20})
#end_method

#begin_method
add_point_last(new_point) 
Adds the point new_point last in the collection points.
Returns self.
Ex:
{polygon p}:add_point_last({20 20})
#end_method

#begin_method
at(index) 
Returns the point at index in the collection points. If index is out of bounds the method returns nil. 
#end_method

#begin_method
change_at(index, x, y) 
Changes the coordinates of the point at index to (x, y).
Returns self. If index is out of bounds the method returns nil.
#end_method

#begin_method
insert_at(index, x, y) 
Inserts a new point with the coordinates (x, y) at index.
Returns self. If index is out of bounds the method returns nil.
#end_method

#begin_method
insert_point_at(index , new_point) 
Inserts new_point at index.
Returns self. If index is out of bounds the method returns nil.
Ex:
{polygon p}:insert_point_at(2, {20 20})
#end_method

#begin_method
linejoin 
Returns the linejoin property of the polyline_object.
#end_method

#begin_method
points 
Returns the points property of the polyline_object.
#end_method

#begin_method
remove_first_point 
Removes the first point of the collection.
Returns self.
Note: You cannot remove a point if there are only two points left.
#end_method

#begin_method
remove_last_point 
Removes the last point of the collection.
Returns self.
Note: You cannot remove a point if there are only two points left.
#end_method

#begin_method
remove_point_at(index) 
Removes the point at index.
Returns self. If index is out of bounds the method returns nil.
#end_method

#begin_method
replace_point_at(index , new_point) 
Replaces the point at index with new_point.
Returns self. If index is out of bounds the method returns nil.
Ex:
{polygon p}:replace_point_at(2, {20 20})
#end_method

#begin_method
set_linejoin(mode) 
Sets the linejoin property to mode.
The different types of linejoin are:
#sharp
#round
#chopped
Returns self.
#end_method

#begin_method
size 
Returns the number of points in points.
#end_method

Class Methods 

#begin_class_method
new 
You cannot create instances of the class polyline_object since it is an abstract class.
Ex:
{polyline_object}:new
raises an exception
Exception:
The message new was sent to the class polyline_object but polyline_object is an abstract class which you can't make instances of
#end_class_method